package com.wingscode.modules.sys.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.wingscode.common.validator.group.AddGroup;
import com.wingscode.common.validator.group.UpdateGroup;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 搜索历史
 *
 * @author yan
 */
@Data
@TableName("search_log")
public class SearchLogEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * ID
	 */
	@TableId
	private Integer Id;

	/**
	 * 用户id
	 */
	@NotNull(message="userId不能为空", groups = {AddGroup.class, UpdateGroup.class})
	@TableField("user_id")
	private Integer userId;

	/**
	 * 检索内容
	 */
	@NotBlank(message="content不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String content;

	/**
	 * 创建时间
	 */
	@TableField("create_time")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
	private Date createTime;

}
